import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import {resolve} from 'path'
// https://vite.dev/config/
export default defineConfig({
  base: "/szxbgraph",
  envDir: "env",
  envPrefix: ['VITE_'],
  plugins: [vue()],
  resolve: {
    alias: [
      {
        find: '@',
        replacement: resolve(__dirname, "src"),
      }
    ]
  },
  server: {
    host: '0.0.0.0',
    port: 2000,
    proxy: {
      '/api': {
        target: 'http://lndx.sundeinfo.cn/api',
        changeOrigin: true,
        rewrite: path => path.replace(/^\/api/, '')
      }
    },
  }
})
